import { createRouter, createWebHashHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
//导入自己的页面文件
import IdenxVue from '../views/Index.vue'
import page1 from "../views/Page1.vue";
import page2 from "../views/Page2.vue";
import StudentView from "../views/StudentView.vue";
import Homework from "../views/Index.vue";
import course from "../views/course.vue";
import teacher from "../views/teacher.vue";
import score from "../views/score.vue";
import workindex from "@/views/workindex";

const routes = [
  {
    path: '/',      //路径 /代表首页
    name: 'work',  //名称
    component: workindex,   //组件
    children:[
      {
        path: '/student',      //路径 /代表首页
        name: 'student',  //名称
        component: StudentView   //组件
      },{
        path: '/course',      //路径 /代表首页
        name: 'course',  //名称
        component: course   //组件
      },{
        path: '/score',      //路径 /代表首页
        name: 'score',  //名称
        component: score   //组件
      },{
        path: '/teacher',      //路径 /代表首页
        name: 'teacher',  //名称
        component: teacher   //组件
      }

    ]
  },






// const routes = [
//   {
//     path: '/',      //路径 /代表首页
//     name: 'index',  //名称
//     component: IdenxVue  , //组件
//     children:[
//       {
//         path: '/page1',      //路径 /代表首页
//         name: 'page1',  //名称
//         component: page1   //组件
//       }, {
//         path: '/page2',      //路径 /代表首页
//         name: 'page2',  //名称
//         component: page2   //组件
//       },//子页面配置
//       {
//         path: '/student',      //路径 /代表首页
//         name: 'student',  //名称
//         component: StudentView   //组件
//       },
//
//     ]},

//{
  //   path: '/page1',      //路径 /代表首页
  //   name: 'page1',  //名称
  //   component: page1   //组件
  // }, {
  //   path: '/page2',      //路径 /代表首页
  //   name: 'page2',  //名称
  //   component: page2   //组件
  // },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: function () {
      return import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
    }
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
